/**
 * @Author wonghiu
 * @Date 2021/8/2 19:33
 * @Version 1.0.1
 */
public class shopeeTwo {
    public static void main(String[] args) {
        int m = 7;
        int k = 3;
        getResult(m,k);
    }

    private static void getResult(int m, int k) {
        // dp[i][j]表示将i分称j份
        int[][] dp = new int[m+1][k+1];
        for (int i = 0; i <= m; i++) {
            dp[i][1] = 1;
        }
        for (int i = 2; i <= m; i++) {
            for (int j = 2; j <= k ; j++) {
                if (i>j){
                    dp[i][j] = dp[i-1][j-1]+dp[i-j][j];
                }else {
                    dp[i][j] = dp[i-1][j-1];
                }
            }
        }
        System.out.println(dp[m][k]);
        return;
    }
}

